package top.glkj.hms.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;
import lombok.Setter;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import java.util.Date;

/**
 * @author : xgl
 * @version : 0.0.1
 * @date :2020/11/1 0:33
 * 用户详情
 * 用户详细信息，需加密处理，仅供用户可见或系统校验使用
 */
@Entity
@Getter
@Setter
@Table(name = "hms_user_detail")
public class UserDetail extends BaseEntity {
    /**
     * 姓名
     */
    @Column(name = "user_name", nullable = false)
    private String userName;
    /**
     * 身份证
     */
    @Column(name = "id_card", nullable = false, unique = true)
    private String idCard;
    /**
     * 性别
     */
    private boolean sex;
    /**
     * 头像
     */
    @OneToOne
    private Img icon;
    /**
     * 出生日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date birthday;
    /**
     * QQ号
     */
    @Column(name = "mobile_qq")
    private String mobileQq;
    /**
     * 微信号
     */
    @Column(name = "mobile_wechat")
    private String mobileWeChat;
    /**
     * 支付宝号
     */
    @Column(name = "mobile_alipay")
    private String mobileAliPay;
    /**
     * 邮箱号
     */
    private String email;
    /**
     * 银行卡号，多个银行卡，隔开
     */
    @Column(name = "bankcard")
    private String bankCards;

    @Override
    public String toString() {
        return "UserDetail{" +
                "userName='" + userName + '\'' +
                ", idCard='" + idCard + '\'' +
                ", sex=" + sex +
                ", icon='" + icon + '\'' +
                ", birthday=" + birthday +
                ", mobileQq='" + mobileQq + '\'' +
                ", mobileWeChat='" + mobileWeChat + '\'' +
                ", mobileAliPay='" + mobileAliPay + '\'' +
                ", email='" + email + '\'' +
                ", bankCards='" + bankCards + '\'' +
                '}';
    }

}
